package com.wwj.my_ummary.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wwj.my_ummary.goods.entity.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wwj
 * @since 2021-01-14
 */
public interface OrderMapper extends BaseMapper<Order> {
    /**
     * 插入订单
     * 注意: order表是关键字，需要`order`
     * @param order
     */
    @Insert("INSERT INTO `order` (uid, gid) VALUES (#{uid}, #{gid})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insertOrder(Order order);
}
